package com.hisense.settings.util;

import android.content.Context;
import android.preference.SeekBarPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener; 
import com.google.android.tv.settings.TvSettings;
import com.hisense.settings.PowerOnSettings;
import com.hisense.settings.PowerOnSoundPreference;
import com.android.settings.DisplaySettings;
import com.hisense.settings.LocalSettings;




public class PowerDataGettings{
    
    private static final String TAG = "PowerDataGettings";
	private Context mContext;
	private static PowerDataGettings mPowerDataGettingsInstance = null;
	public static SharedPreferences mSharedPrefs;
	public static SharedPreferences.Editor editor;

	private static final String KEY_SOTORE_MODE_ENABLE = "store_mode_enable";

	public String mPowerOnSource;	
	
    public PowerDataGettings(Context context) {
		mContext = context;
		mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
		editor = mSharedPrefs.edit();
    }
	public int getModeImageCustomColor() {	
		int data = mSharedPrefs.getInt(DisplaySettings.CUSTOM_MODE_COLORTEMPERETURE, 0);	
		return data;
	}	
	public int getModeImageCustomDynamic() {	
		int data = mSharedPrefs.getInt(DisplaySettings.CUSTOM_MODE_DYNAMICNOISE, 0);	
		return data;
	}		
	public boolean getRetailModeIsEnable() {	
		boolean data = mSharedPrefs.getBoolean(DisplaySettings.RETAILMODE_HASSAVE, false);	
		return data;
	}
	public int getRetailModeImage() {	
		int data = mSharedPrefs.getInt(DisplaySettings.RETAILMODE_IMAGEMODE, 0);	
		return data;
	}
	public int getRetailModeNoise() {	
		int data = mSharedPrefs.getInt(DisplaySettings.RETAILMODE_DYNAMICNOISEMODE, 0);	
		return data;
	}
	public boolean getRetailModeBacklight() {	
		boolean data = mSharedPrefs.getBoolean(DisplaySettings.RETAILMODE_DYNAMICBACKLIGHT, false);	
		return data;
	}
	public boolean getRetailModeContrast() {	
		boolean data = mSharedPrefs.getBoolean(DisplaySettings.RETAILMODE_DYNAMICCONTRAST, false);	
		return data;
	}

	public String getCurrentImageMode() {	
		String data = mSharedPrefs.getString(DisplaySettings.KEY_IMAGE_MODE, "0");	
		return data;
	}
	public String getCurrentDynamicNoiseMode() {
		String data = mSharedPrefs.getString(DisplaySettings.KEY_IMAGE_MODE, "0");	
		return data;
	}
	public boolean getCurrentRetailMode() {
		//boolean data = mSharedPrefs.getBoolean(LocalSettings.KEY_CHECKBOX_RETAIL, false);	
		boolean data = TvSettings.Secure.getBoolean(mContext.getContentResolver(),
                    KEY_SOTORE_MODE_ENABLE,false);
		return data;
	}

	public String getPowerOnSource() {
		String data = mSharedPrefs.getString(PowerOnSettings.KEY_POWER_ON_SOURCE, "0");	
		return data;
	}
	
	/*
	public String getPowerOnChannelServiceId() {
		mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
		String data = mSharedPrefs.getString(PowerOnSettings.KEY_POWER_ON_CHANNEL_SERVICEID, "-1");	
		return data;
	}
	*/
	public String getPowerOnChannelMajor() {
		String data = mSharedPrefs.getString(PowerOnSettings.KEY_POWER_ON_CHANNEL_MAJORNO, "-1");	
		return data;
	}	
	public String getPowerOnChannelMinor() {
		String data = mSharedPrefs.getString(PowerOnSettings.KEY_POWER_ON_CHANNEL_MINOR, "-1");	
		return data;
	}
	public boolean getPowerOnSoundEnable() {
		boolean data = mSharedPrefs.getBoolean(PowerOnSettings.KEY_POWER_ON_SOUND_SWITCH, false);	
		return data;
	}	
	public String getPowerOnSound() {
		String data = mSharedPrefs.getString(PowerOnSoundPreference.KEY_POWER_ON_SOUND, "30");	
		return data;
	}


}

